<?php
//演示列表数据用法
include('./'.DIRECTORY_SEPARATOR.'Credis.php');
$Credis=Credis::init();

echo "<br/>";
echo  '读';var_dump($Credis->lrange('user_name'));
echo "<br/>";
echo '左写'.$Credis->lpush('user_name',rand(10000,99999));
echo "<br/>";
echo  '长度'.$Credis->llen('user_name');
echo "<br/>";
echo  '读';var_dump($Credis->lrange('user_name'));
echo "<br/>";
echo '左读'.$Credis->lpop('user_name',rand(10000,99999));
echo "<br/>";
echo '右写'.$Credis->rpush('user_name',rand(10000,99999));
echo "<br/>";
echo  '长度'.$Credis->llen('user_name');
echo "<br/>";
echo  '读';var_dump($Credis->lrange('user_name'));
echo "<br/>";
echo '右读'.$Credis->rpop('user_name',rand(10000,99999));
echo "<br/>";
echo "<br/>";
echo  '读';var_dump($Credis->lrange('user_name'));
echo "<br/>";
echo  '长度'.$Credis->llen('user_name');
echo "<br/>";
echo  'lrange 2';var_dump($Credis->lrange('user_name',2));
echo "<br/>";
echo  'lrange-2';var_dump($Credis->lrange('user_name',-2));
echo "<br/>";
echo  'lrange 2-2';var_dump($Credis->lrange('user_name',2,-2));
echo "<br/>";
echo  'lrange 2 2';var_dump($Credis->lrange('user_name',2,2));
echo "<br/>";
echo  'lrange-2-2';var_dump($Credis->lrange('user_name',-2,-2));
echo "<br/>";
echo  'lrange-2 2';var_dump($Credis->lrange('user_name',-2,2));
echo "<br/>";
echo "<br/>";
echo "<br/>";
echo "<br/>";
echo  '读';var_dump($Credis->slice('user_name'));
echo "<br/>";
echo  'slice2';var_dump($Credis->slice('user_name',2));
echo "<br/>";
echo  'slice-2';var_dump($Credis->slice('user_name',-2));
echo "<br/>";
echo  'slice2-2';var_dump($Credis->slice('user_name',2,-2));
echo "<br/>";
echo  'slice2 2';var_dump($Credis->slice('user_name',2,2));
echo "<br/>";
echo  'slice-2-2';var_dump($Credis->slice('user_name',-2,-2));
echo "<br/>";
echo  'slice-2 2';var_dump($Credis->slice('user_name',-2,2));
echo "<br/>";

echo "<br/>";
echo "<br/>";
echo 'end';
exit;

?>